/* eslint-disable @typescript-eslint/no-unused-vars */
/* eslint-disable prettier/prettier */
import { Input } from "antd"
import { FC } from "react"

import { SFormItem } from "@/components/common"
import { useLocale } from "@/locales"
import { validateUser } from "@/utils/validate"

export type userNameInputField = {
	userNameInputCode: string
}
const UserNameInput: FC<any> = props => {
	const { formatMessage } = useLocale()
	const { required, placeholder } = props
	return (
		<SFormItem
			name="userName"
			label={formatMessage({ id: "funds.user_name" })}
			rules={[
				{
					required: true,
					validator: (_: any, value: any) => validateUser(formatMessage, value)
				}
			]}
		>
			<Input allowClear style={{ width: "200px" }} placeholder={formatMessage({ id: placeholder })} />
		</SFormItem>
	)
}

export default UserNameInput
